﻿using System;
using System.Windows.Forms;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Pipeline.Design;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;

namespace SSISComponents
{
    class ShapeFileSourceUI : IDtsComponentUI
    {

        #region Members

            IDTSComponentMetaData100 metaData;
            IServiceProvider serviceProvider;

        #endregion

        #region IDtsComponentUI Member

        bool IDtsComponentUI.Edit(IWin32Window parentWindow, Variables variables, Connections connections)
        {
            frmMain editor = new frmMain(metaData, serviceProvider, variables, connections);

            if (editor.ShowDialog(parentWindow) == DialogResult.OK)
            {
                return true;
            }

            return false;
        }

        void IDtsComponentUI.Help(IWin32Window parentWindow) {}

        void IDtsComponentUI.Initialize(IDTSComponentMetaData100 dtsComponentMetadata, IServiceProvider serviceProvider)
        {
            this.metaData = dtsComponentMetadata;
            this.serviceProvider = serviceProvider;
        }

        void IDtsComponentUI.New(IWin32Window parentWindow){}

        void IDtsComponentUI.Delete(IWin32Window parentWindow)
        {

        }

        #endregion

    }
}
